Last updated: 2023-07-14

Checks: 6 1

Knit directory: scSeq_Hefendehl/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20220131) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 982b9f6. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .RData
    Ignored:    .Rproj.user/
    Ignored:    data/20230203/
    Ignored:    data/Alignments/
    Ignored:    data/Cluster.markers_02-02-2023.xlsx
    Ignored:    data/DAM_genelists.RData
    Ignored:    data/DEG_control_vs_stroke.xlsx
    Ignored:    data/ReloadAllData_Hefendehl_Stroke_Dec'21.RData
    Ignored:    data/Sample_Tables/
    Ignored:    data/Stroke-SS2_SCT-harmony_Hefendehl.html
    Ignored:    data/counts.csv
    Ignored:    data/genecounts.csv
    Ignored:    data/microglia-SCT_02-02-23.rds
    Ignored:    data/microglia_protein.rds
    Ignored:    data/samples.integrated.RData
    Ignored:    data/seu-SCT-harmony_02-02-23.rds
    Ignored:    data/seu_filtered_nonorm_02-02-23.rds
    Ignored:    data/tx2genes.csv
    Ignored:    output/integrated_analysis.RData
    Ignored:    output/integrated_analysis.RDataTmp

Untracked files:
    Untracked:  shinySecret.R
    Untracked:  wflowhelper.R

Unstaged changes:
    Modified:   _workflowr.yml
    Modified:   analysis/00.1_Original_Analysis_Integrated.Rmd
    Modified:   analysis/01_Biostat.Rmd
    Modified:   data/README.md
    Modified:   geneviewer/Dataset.RData
    Modified:   geneviewer/app.R
    Modified:   geneviewer/rsconnect/shinyapps.io/molgenlab/geneviewer.dcf

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/00.1_Original_Analysis_Integrated.Rmd) and HTML (docs/00.1_Original_Analysis_Integrated.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
html 982b9f6 Andreas Chiocchetti 2023-02-20 Build site.
Rmd 438f7ad Andreas Chiocchetti 2023-02-20 workflowr::wflow_publish(c("./docs/", "./analysis/", "./code/*",
html 0e20f22 Andreas Chiocchetti 2023-02-16 Build site.
Rmd eaa373d Andreas Chiocchetti 2023-02-16 workflowr::wflow_publish(c("./docs/", "./analysis/", "./code/*",
html eaa373d Andreas Chiocchetti 2023-02-16 workflowr::wflow_publish(c("./docs/", "./analysis/", "./code/*",

Preprocessing

QC metrics from AG Hefendehl (Stroke)

Combined datasets and filter cells that have unique feature counts (gene number) over 7000 or less than 200 and cells with >5% mitochondrial counts.

# Visualize QC metrics as a violin plot
Idents(plates_hefendehl) <- "Plate"
VlnPlot(plates_hefendehl, features = c("nFeature_RNA", "nCount_RNA", "percent.mt","percent.rp"), 
        group.by = "Plate", ncol = 4)

Version Author Date
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
SampleMeta=plates_hefendehl@meta.data
cormt<- cor(SampleMeta$nCount_RNA, SampleMeta$percent.mt, method="spearman")
corfeat<- cor(SampleMeta$nCount_RNA, SampleMeta$nFeature_RNA, method="spearman")

plot1 <- ggplot(plates_hefendehl@meta.data,aes(x=nCount_RNA, y=percent.mt, col=Plate))+
  geom_point()+theme_classic()+geom_abline(slope = 0, intercept = 5)+labs(title=cormt)
plot2 <- ggplot(plates_hefendehl@meta.data,aes(x=nCount_RNA, y=nFeature_RNA, col=Plate))+geom_point()+theme_classic()+geom_abline(slope = 0, intercept = 7000)+
  ggtitle(corfeat)

plot1 | plot2

Version Author Date
eaa373d Andreas Chiocchetti 2023-02-16

Perform integrated analysis

Version Author Date
eaa373d Andreas Chiocchetti 2023-02-16

Version Author Date
eaa373d Andreas Chiocchetti 2023-02-16

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

PCA, tSNE and UMAP from the first 30 dimensions and with a resolution of 0.8

# Visualization

Idents(samples.integrated) <- "seurat_clusters"
DimPlot(samples.integrated, reduction = "umap", split.by = "Treatment")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
eaa373d Andreas Chiocchetti 2023-02-16
p1<- DimPlot(samples.integrated, reduction = "umap", group.by = "Plate")
p1a<- DimPlot(samples.integrated, reduction = "umap", group.by = "Mouse_ID")
p1b<- DimPlot(samples.integrated, reduction = "umap", group.by = "Genotype_Treatment")
  

p1 + p1a +  p1b

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
DimPlot(samples.integrated, group.by = "seurat_clusters", pt.size =1, label = T) + NoLegend()

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
eaa373d Andreas Chiocchetti 2023-02-16
DimPlot(samples.integrated, reduction = "umap", split.by = "Plate", pt.size= 1)

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
DimPlot(samples.integrated, reduction = "umap", split.by = "Genotype_Treatment", pt.size =1)

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Cell cycle scoring

First, a score is assigned to each cell (Tirosh et al. 2016), based on its expression of G2/M and S phase markers. These markers should be anticorrelated in their expression levels and cells expression neither are likely not cycling and in G1 phase. Note: For downstream cell cylce regression the quantitative scores for G2/M and S phase are used, not the dicrete classification.

Cluster distribution

DimPlot(object = samples.integrated, pt.size = 1,reduction = "umap", group.by="Age",label = F) +
  ggtitle("Cluster distribution according to Age") + theme_classic()| DimPlot(object = samples.integrated, pt.size = 1,reduction = "umap", group.by="Genotype_Treatment",label = F) +
  ggtitle("Cluster distribution according to Genotype + Treatment")+ theme_classic()

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
DimPlot(object = samples.integrated, pt.size = 1,reduction = "umap", group.by="Plate",label = F) +
  ggtitle("Cluster distribution according to Plate")+ theme_classic() | DimPlot(object = samples.integrated, pt.size = 1,reduction = "umap", group.by = "seurat_clusters", label = T) +
  ggtitle("Clustering")+ theme_classic()

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
Idents(samples.integrated) <- "seurat_clusters"

# use same colors for clusters as in plots
require(scales)

samples.integrated$seurat_clusters = factor(samples.integrated$seurat_clusters, levels=sort(as.character(unique(samples.integrated$seurat_clusters))))
identities <- levels(samples.integrated$seurat_clusters) # Create vector with levels of object@ident
cluster_colors <- hue_pal()(length(identities)) # Create vector of default ggplot2 colors


# number of cells in each cluster 
cluster_nCell <- as.data.frame.matrix(table(samples.integrated$seurat_clusters,
                                            samples.integrated$Genotype_Treatment))
cluster_nCell["Total" ,] = colSums(cluster_nCell)
cluster_nCell
      APPPS1_Ctrl APPPS1_Stroke WT_Ctrl WT_Stroke
0             164            38     108        62
1              28            15      28        15
2              10             5      42         0
3               0             0       4         0
4               0             0       8         0
5               6             1       5         3
6               1             4       7         8
Total         209            63     202        88
# % of cells in each cluster , grouped by genotype_Age

cluster_per_Cell <- data.frame(table(samples.integrated$seurat_clusters, 
                              samples.integrated$Age))
colnames(cluster_per_Cell) <- c("Cluster", "Age", "Frequency")
cluster_per_Cell
   Cluster      Age Frequency
1        0 37 weeks       226
2        1 37 weeks        56
3        2 37 weeks        41
4        3 37 weeks         2
5        4 37 weeks         6
6        5 37 weeks         7
7        6 37 weeks        11
8        0 38 weeks        44
9        1 38 weeks         8
10       2 38 weeks        13
11       3 38 weeks         2
12       4 38 weeks         2
13       5 38 weeks         4
14       6 38 weeks         3
15       0 40 weeks       102
16       1 40 weeks        22
17       2 40 weeks         3
18       3 40 weeks         0
19       4 40 weeks         0
20       5 40 weeks         4
21       6 40 weeks         6
cluster_percent_Cell <- data.frame(round((prop.table(x = table(samples.integrated$seurat_clusters, 
                              samples.integrated$Age), margin = 2)*100),2))
colnames(cluster_percent_Cell) <- c("Cluster", "Age", "Frequency")
cluster_percent_Cell
   Cluster      Age Frequency
1        0 37 weeks     64.76
2        1 37 weeks     16.05
3        2 37 weeks     11.75
4        3 37 weeks      0.57
5        4 37 weeks      1.72
6        5 37 weeks      2.01
7        6 37 weeks      3.15
8        0 38 weeks     57.89
9        1 38 weeks     10.53
10       2 38 weeks     17.11
11       3 38 weeks      2.63
12       4 38 weeks      2.63
13       5 38 weeks      5.26
14       6 38 weeks      3.95
15       0 40 weeks     74.45
16       1 40 weeks     16.06
17       2 40 weeks      2.19
18       3 40 weeks      0.00
19       4 40 weeks      0.00
20       5 40 weeks      2.92
21       6 40 weeks      4.38
cluster_per_Treatment <- data.frame(table(samples.integrated$seurat_clusters, 
                              samples.integrated$Genotype_Treatment))
colnames(cluster_per_Treatment) <- c("Cluster", "Genotype_Treatment", "Frequency")
cluster_per_Treatment
   Cluster Genotype_Treatment Frequency
1        0        APPPS1_Ctrl       164
2        1        APPPS1_Ctrl        28
3        2        APPPS1_Ctrl        10
4        3        APPPS1_Ctrl         0
5        4        APPPS1_Ctrl         0
6        5        APPPS1_Ctrl         6
7        6        APPPS1_Ctrl         1
8        0      APPPS1_Stroke        38
9        1      APPPS1_Stroke        15
10       2      APPPS1_Stroke         5
11       3      APPPS1_Stroke         0
12       4      APPPS1_Stroke         0
13       5      APPPS1_Stroke         1
14       6      APPPS1_Stroke         4
15       0            WT_Ctrl       108
16       1            WT_Ctrl        28
17       2            WT_Ctrl        42
18       3            WT_Ctrl         4
19       4            WT_Ctrl         8
20       5            WT_Ctrl         5
21       6            WT_Ctrl         7
22       0          WT_Stroke        62
23       1          WT_Stroke        15
24       2          WT_Stroke         0
25       3          WT_Stroke         0
26       4          WT_Stroke         0
27       5          WT_Stroke         3
28       6          WT_Stroke         8
cluster_percent_Treatment <- data.frame(round((prop.table(x = table(samples.integrated$seurat_clusters, 
                              samples.integrated$Genotype_Treatment), margin = 2)*100),2))
colnames(cluster_percent_Treatment) <- c("Cluster", "Genotype_Treatment", "Frequency")
cluster_percent_Treatment
   Cluster Genotype_Treatment Frequency
1        0        APPPS1_Ctrl     78.47
2        1        APPPS1_Ctrl     13.40
3        2        APPPS1_Ctrl      4.78
4        3        APPPS1_Ctrl      0.00
5        4        APPPS1_Ctrl      0.00
6        5        APPPS1_Ctrl      2.87
7        6        APPPS1_Ctrl      0.48
8        0      APPPS1_Stroke     60.32
9        1      APPPS1_Stroke     23.81
10       2      APPPS1_Stroke      7.94
11       3      APPPS1_Stroke      0.00
12       4      APPPS1_Stroke      0.00
13       5      APPPS1_Stroke      1.59
14       6      APPPS1_Stroke      6.35
15       0            WT_Ctrl     53.47
16       1            WT_Ctrl     13.86
17       2            WT_Ctrl     20.79
18       3            WT_Ctrl      1.98
19       4            WT_Ctrl      3.96
20       5            WT_Ctrl      2.48
21       6            WT_Ctrl      3.47
22       0          WT_Stroke     70.45
23       1          WT_Stroke     17.05
24       2          WT_Stroke      0.00
25       3          WT_Stroke      0.00
26       4          WT_Stroke      0.00
27       5          WT_Stroke      3.41
28       6          WT_Stroke      9.09
# Grouped barchart of cell proportions
a1<- ggplot(cluster_percent_Cell, aes(fill=Age, 
                                 y=Frequency, 
                                 x=Cluster)) +
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to Age [%]") +theme_classic()+
  theme(axis.text.x = element_text(angle = 45, hjust=1, vjust=1)) +
  xlab("")


# Grouped barchart of cell proportions
b1 <- ggplot(cluster_percent_Cell, aes(fill=Cluster, y=Frequency, x=Age)) + 
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to Age [%]") +theme_classic()+
  theme(axis.text.x = element_text(angle = 45, hjust=1, vjust=1))


c1 <-ggplot(cluster_percent_Cell, aes(fill=Cluster, y=Frequency, x=Age)) + 
    geom_bar(position="stack", stat="identity")+theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=1))

a1 | b1 | c1

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
# Grouped barchart of cell proportions
a1<- ggplot(cluster_percent_Treatment, aes(fill=Genotype_Treatment, 
                                 y=Frequency, 
                                 x=Cluster)) +
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to Genotype_Treatment [%]") +theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=1)) +
  xlab("")


# Grouped barchart of cell proportions
b1 <- ggplot(cluster_percent_Treatment, aes(fill=Cluster, y=Frequency, x=Genotype_Treatment)) + 
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to Genotype_Treatment [%]") +theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=1))


c1 <-ggplot(cluster_percent_Treatment, aes(fill=Cluster, y=Frequency, x=Genotype_Treatment)) + 
    geom_bar(position="stack", stat="identity")+theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=1))

a1 | b1 | c1

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Cell type identification

Finding differentially expressed features (cluster biomarkers)

Idents(samples.integrated) <- samples.integrated$seurat_clusters
samples.integrated=PrepSCTFindMarkers(samples.integrated)

markers <- FindAllMarkers(object = samples.integrated, 
                          only.pos = TRUE,
                          logfc.threshold = 0.25)  


DefaultAssay(samples.integrated) = "SCT"

markers %>%
    group_by(cluster) %>%
    top_n(n = 20, wt = avg_log2FC) -> top20

DoHeatmap(samples.integrated, features = top20$gene) + NoLegend() + ggtitle("Top20 cluster marker genes")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

SingleR

SingleR is an automatic annotation method for (scRNAseq) data (Aran et al. 2019). Given a reference dataset of samples (single-cell or bulk) with known labels, it labels new cells from a test dataset based on similarity to the reference set. Here we use the built-in references “Immgen” (830 microarray samples of sorted hematopoetic and immune cell populations) and “Mouse RNA-Seq” (358 non-specific mouse RNA-seq samples).

Immgen reference

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

MouseRNA-Seq reference Section Skipped as pred.mouseRNA object is not available

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
# number of cells in each cluster 
cluster_nCell <- data.frame(table(samples.integrated$MouseRNASeq_sc_labels,samples.integrated$Genotype_Treatment))
colnames(cluster_nCell) <- c( "MouseRNASeq_sc_labels", "Genotype_Treatment","Number")

#cluster_nCell["Total" ,] = colSums(cluster_nCell)
# cluster_nCell

# % of cells in each cluster 
cluster_percent_Cell <- data.frame(round((prop.table(x = table(samples.integrated$MouseRNASeq_sc_labels, 
                              samples.integrated$Genotype_Treatment), margin = 2)*100),2))
colnames(cluster_percent_Cell) <- c("MouseRNASeq_sc_labels", "Genotype_Treatment", "Frequency")
# cluster_percent_Cell


# Grouped barchart of absolute cell numbers
ggplot(cluster_nCell, aes(fill=Genotype_Treatment, y=Number, x=MouseRNASeq_sc_labels)) + 
  geom_bar(position="dodge", stat="identity") +
  ggtitle("Cell distribution according to MouseRNASeq reference (absolut values)")+ theme_classic() +
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=0.5)) +
  xlab("")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
# Grouped barchart of cell proportions
ggplot(cluster_percent_Cell, aes(fill=Genotype_Treatment, y=Frequency, x=MouseRNASeq_sc_labels)) + 
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to MouseRNASeq reference [%]")+ theme_classic() +
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=0.5)) +
  xlab("")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
# number of cells in each cluster 
cluster_nCell <- data.frame(table(samples.integrated$Immgen_sc_labels,samples.integrated$Genotype_Treatment))
colnames(cluster_nCell) <- c( "Immgen_sc_labels", "Genotype_Treatment","Number")

#cluster_nCell["Total" ,] = colSums(cluster_nCell)
# cluster_nCell

# % of cells in each cluster 
cluster_percent_Cell <- data.frame(round((prop.table(x = table(samples.integrated$Immgen_sc_labels, 
                              samples.integrated$Genotype_Treatment), margin = 2)*100),2))
colnames(cluster_percent_Cell) <- c( "Immgen_sc_labels", "Genotype_Treatment","Frequency")
# cluster_percent_Cell


# Grouped barchart of absolute cell numbers
ggplot(cluster_nCell, aes(fill=Genotype_Treatment, y=Number, x=Immgen_sc_labels)) + 
  geom_bar(position="dodge", stat="identity") +
  ggtitle("Cell distribution according to Immgen reference (absolut values)") + theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=0.5)) +
  xlab("")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
# Grouped barchart of cell proportions
ggplot(cluster_percent_Cell, aes(fill=Genotype_Treatment, y=Frequency, x=Immgen_sc_labels)) + 
  geom_bar(position="dodge", stat="identity")+
  ggtitle("Cell distribution according to Immgen reference [%]") + theme_classic()+
  theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=0.5)) +
  xlab("")

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Renaming Clusters

Idents(samples.integrated) = "Celltype"
DimPlot(samples.integrated, reduction = "umap", label=T) + NoLegend()+ theme_classic()

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Zoom into Microglia clusters

A second Seurat cluster is generated, where all non-microglial immune cells are removed according to the mouseRNASeq_sc_labels.

samples.microglia <- samples.integrated[,grepl("Microgli.*", samples.integrated$MouseRNASeq_sc_labels)]

p3 <- DimPlot(samples.microglia, reduction = "umap", label=T, group.by = "MouseRNASeq_sc_labels")  + theme_classic()+ NoLegend()

p3a <- DimPlot(samples.microglia, reduction = "umap", label=T, group.by = "seurat_clusters") + theme_classic()+ NoLegend()

p3 + p3a

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

DAMs (Cell. 2017 Jun 15;169(7):1276-1290.e17. doi: 10.1016/j.cell.2017.05.018)

DAM plotting

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16
DAM2_marker_gene_list <- list(Stage2_DAM_up)
samples.microglia <- AddModuleScore(object = samples.microglia, 
                                    features = DAM2_marker_gene_list, name = "DAM2_score")
p5 <- FeaturePlot(object = samples.microglia, features = "DAM2_score1")+scale_color_viridis_c()
Scale for colour is already present.
Adding another scale for colour, which will replace the existing scale.
p5a <- DimPlot(object = samples.microglia, reduction = "umap")

p5 | p5a

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

DAM 2 Markers

DAM2 upreagulated markers

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

DAM2 dowreagulated markers

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

points of interest spatial sequencing

Special Seq plotting

Renaming clusters

Idents(samples.microglia) <- "Celltype"
DimPlot(samples.microglia, reduction = "umap", label = TRUE, pt.size = 1)+ NoLegend()

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Signature enrichment

All enrichment tests were done with gprofiler 2

Tested Ontologies and Signatures GO:MF = Molecular Function GO:BP = Biological Processes GO:CC = Cellular Compartment), KEGG = pathways from KEGG Reactome, TF = regulatory motif matches from TRANSFAC HPA = tissue specificity from Human Protein Atlas; CORUM = protein complexes from CORUM HP = human disease phenotypes from Human Phenotype Ontology.

For more dteails see Website: https://biit.cs.ut.ee/gprofiler/gost

DEGs and GSEA across microglia of different genotypes

log fold-change of the average expression between the two groups: Positive values indicate that the gene is more highly expressed in the target group (e.g. the APPPS1+ group)

WT vs App

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

WT vs MX04+

log fold-chage of the average expression between the two groups: Positive values indicate that the gene is more highly expressed in the Methoxy positive group

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

MX04+ vs MX04- in APPPS1 cohort only


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |======================================================================| 100%

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

DEGs and GSEA of microglia of different genotype and treatment

WT_Ctrl vs WT_Stroke


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

APP_Ctrl vs APP_Stroke

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

WT_Ctrl vs APP_Ctrl


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

WT_Stroke vs APP_Stroke


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

DEGs and GSEA of each cluster

log fold-chage of the average expression between the two groups: Positive values indicate that the gene is more highly expressed in the target group (e.g. Microglia 0) versus all others.

Microglia_0

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Microglia_1

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Microglia_2

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Microglia_3

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Microglia_4

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Microglia_5

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20

Spatial Subgroup Controls

Genotype + Treatment comparison in each cluster

Idents(samples.microglia) <- "Genotype_Treatment"

mg1 <- samples.microglia[,samples.microglia$Celltype == "Microglia_1"]
mg1 <- SCTransform(mg1)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 23747 by 371
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 371 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 1 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 3 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 23747 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 23747 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 4.460372 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
mg1.markers.Genotype_Treatment <- FindAllMarkers(mg1)
Calculating cluster WT_Stroke
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
if(length(mg1.markers.Genotype_Treatment)!=0){
mg1_top20 = mg1.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
mg1_top20chk=T
} else {mg1_top20chk=F}

mg2 <- samples.microglia[,samples.microglia$Celltype == "Microglia_2"]
mg2 <- SCTransform(mg2)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 15372 by 86
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 86 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 1 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 34 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 15372 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 15372 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 1.91747 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
mg2.markers.Genotype_Treatment <- FindAllMarkers(mg2)
Calculating cluster WT_Stroke
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
if(length(mg2.markers.Genotype_Treatment)!=0){
mg2_top20 = mg2.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
mg2_top20chk=T
} else {mg2_top20chk=F}

mg3 <- samples.microglia[,samples.microglia$Celltype == "Microglia_3"]
mg3 <- SCTransform(mg3)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 17416 by 57
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 57 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 4 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 36 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 17416 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 17416 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 1.856266 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
mg3.markers.Genotype_Treatment <- FindAllMarkers(mg3)
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
if(length(mg3.markers.Genotype_Treatment)!=0){
mg3_top20 = mg3.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
mg3_top20chk=T
} else {mg3_top20chk=F}

mg4 <- samples.microglia[,samples.microglia$Celltype == "Microglia_4"]
mg4 <- SCTransform(mg4)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 2188 by 8
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 8 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 25 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 47 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 2188 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 2188 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 1.100552 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
mg4.markers.Genotype_Treatment <- FindAllMarkers(mg4)
Calculating cluster WT_Ctrl
Warning: No DE genes identified
Warning: The following tests were not performed:
Warning: When testing WT_Ctrl versus all:
    Cell group 2 is empty - no cells with identity class 
if(length(mg4.markers.Genotype_Treatment)!=0){
mg4_top20 = mg4.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
mg4_top20chk=T
} else {mg4_top20chk=F}

mg5 <- samples.microglia[,samples.microglia$Celltype == "Microglia_5"]
mg5 <- SCTransform(mg5)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 5172 by 15
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 15 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
Second step: Get residuals using fitted parameters for 5172 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 5172 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 1.203822 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
mg5.markers.Genotype_Treatment <- FindAllMarkers(mg5)
Calculating cluster WT_Stroke
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
Warning: The following tests were not performed:
Warning: When testing APPPS1_Stroke versus all:
    Cell group 1 has fewer than 3 cells
if(length(mg5.markers.Genotype_Treatment)!=0){
mg5_top20 = mg5.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
mg5_top20chk=T
} else {mg5_top20chk=F}

sp_ctrl <- samples.microglia[,samples.microglia$Control_spatial_binary==T]
sp_ctrl <- SCTransform(sp_ctrl)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 11668 by 44
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 44 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 1 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 2 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 11668 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 11668 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 1.5381 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
sp_ctrl.markers.Genotype_Treatment <- FindAllMarkers(sp_ctrl)
Calculating cluster WT_Stroke
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
if(length(sp_ctrl.markers.Genotype_Treatment)!=0){
sp_ctrl_top20 = sp_ctrl.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
sp_ctrl_top20chk=T
} else {sp_ctrl_top20chk=F}

sp_stroke <- samples.microglia[,samples.microglia$Stroke_spatial_binary==T]
sp_stroke <- SCTransform(sp_stroke)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 19085 by 170
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 170 cells

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%
There are 1 estimated thetas smaller than 1e-07 - will be set to 1e-07
Found 3 outliers - those will be ignored in fitting/regularization step
Second step: Get residuals using fitted parameters for 19085 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Computing corrected count matrix for 19085 genes

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 2.530094 secs
Determine variable features
Place corrected count matrix in counts slot
Centering data matrix
Set default assay to SCT
sp_stroke.markers.Genotype_Treatment <- FindAllMarkers(sp_stroke)
Calculating cluster WT_Stroke
Calculating cluster APPPS1_Ctrl
Calculating cluster APPPS1_Stroke
Calculating cluster WT_Ctrl
Warning: The following tests were not performed:
Warning: When testing WT_Ctrl versus all:
    Cell group 1 has fewer than 3 cells
if(length(sp_stroke.markers.Genotype_Treatment)!=0){
sp_stroke_top20 = sp_stroke.markers.Genotype_Treatment %>% group_by(cluster) %>% top_n(n=20, wt=abs(avg_log2FC))
sp_stroke_top20chk=T
} else {sp_stroke_top20chk=F}

Microglia_1

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Microglia_2

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Microglia_3

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

Microglia_4

[1] "no significant markers identified"

Microglia_5

Version Author Date
982b9f6 Andreas Chiocchetti 2023-02-20
0e20f22 Andreas Chiocchetti 2023-02-16
eaa373d Andreas Chiocchetti 2023-02-16

spatial Controls

spatial Stroke

save.image("./output/integrated_analysis.RData")

sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] DESeq2_1.38.3               scales_1.2.1               
 [3] gprofiler2_0.2.1            forcats_1.0.0              
 [5] stringr_1.5.0               dplyr_1.1.0                
 [7] purrr_1.0.1                 readr_2.1.4                
 [9] tidyr_1.3.0                 tibble_3.1.8               
[11] tidyverse_1.3.2             pheatmap_1.0.12            
[13] EnhancedVolcano_1.16.0      ggrepel_0.9.3              
[15] SingleR_2.0.0               SummarizedExperiment_1.28.0
[17] Biobase_2.58.0              GenomicRanges_1.50.2       
[19] GenomeInfoDb_1.34.9         IRanges_2.32.0             
[21] S4Vectors_0.36.1            BiocGenerics_0.44.0        
[23] MatrixGenerics_1.10.0       matrixStats_0.63.0         
[25] ggplot2_3.4.1               SeuratObject_4.1.3         
[27] Seurat_4.3.0                workflowr_1.7.0            

loaded via a namespace (and not attached):
  [1] scattermore_0.8           bit64_4.0.5              
  [3] knitr_1.42                irlba_2.3.5.1            
  [5] DelayedArray_0.24.0       data.table_1.14.6        
  [7] KEGGREST_1.38.0           RCurl_1.98-1.10          
  [9] generics_0.1.3            ScaledMatrix_1.6.0       
 [11] callr_3.7.3               cowplot_1.1.1            
 [13] RSQLite_2.2.20            RANN_2.6.1               
 [15] future_1.31.0             bit_4.0.5                
 [17] tzdb_0.3.0                spatstat.data_3.0-0      
 [19] xml2_1.3.3                lubridate_1.9.2          
 [21] httpuv_1.6.9              assertthat_0.2.1         
 [23] gargle_1.3.0              xfun_0.37                
 [25] hms_1.1.2                 jquerylib_0.1.4          
 [27] evaluate_0.20             promises_1.2.0.1         
 [29] fansi_1.0.4               dbplyr_2.3.0             
 [31] readxl_1.4.2              igraph_1.4.0             
 [33] DBI_1.1.3                 geneplotter_1.76.0       
 [35] htmlwidgets_1.6.1         spatstat.geom_3.0-6      
 [37] googledrive_2.0.0         ellipsis_0.3.2           
 [39] crosstalk_1.2.0           backports_1.4.1          
 [41] annotate_1.76.0           deldir_1.0-6             
 [43] sparseMatrixStats_1.10.0  vctrs_0.5.2              
 [45] ROCR_1.0-11               abind_1.4-5              
 [47] cachem_1.0.6              withr_2.5.0              
 [49] progressr_0.13.0          sctransform_0.3.5        
 [51] goftest_1.2-3             cluster_2.1.4            
 [53] lazyeval_0.2.2            crayon_1.5.2             
 [55] spatstat.explore_3.0-6    pkgconfig_2.0.3          
 [57] labeling_0.4.2            nlme_3.1-162             
 [59] vipor_0.4.5               rlang_1.0.6              
 [61] globals_0.16.2            lifecycle_1.0.3          
 [63] miniUI_0.1.1.1            modelr_0.1.10            
 [65] rsvd_1.0.5                ggrastr_1.0.1            
 [67] cellranger_1.1.0          rprojroot_2.0.3          
 [69] polyclip_1.10-4           lmtest_0.9-40            
 [71] Matrix_1.5-3              zoo_1.8-11               
 [73] reprex_2.0.2              beeswarm_0.4.0           
 [75] whisker_0.4.1             ggridges_0.5.4           
 [77] processx_3.8.0            googlesheets4_1.0.1      
 [79] png_0.1-8                 viridisLite_0.4.1        
 [81] bitops_1.0-7              getPass_0.2-2            
 [83] KernSmooth_2.23-20        Biostrings_2.66.0        
 [85] blob_1.2.3                DelayedMatrixStats_1.20.0
 [87] parallelly_1.34.0         spatstat.random_3.1-3    
 [89] beachmat_2.14.0           memoise_2.0.1            
 [91] magrittr_2.0.3            plyr_1.8.8               
 [93] ica_1.0-3                 zlibbioc_1.44.0          
 [95] compiler_4.2.2            RColorBrewer_1.1-3       
 [97] fitdistrplus_1.1-8        cli_3.6.0                
 [99] XVector_0.38.0            listenv_0.9.0            
[101] patchwork_1.1.2           pbapply_1.7-0            
[103] ps_1.7.2                  MASS_7.3-58.2            
[105] tidyselect_1.2.0          stringi_1.7.12           
[107] highr_0.10                yaml_2.3.7               
[109] BiocSingular_1.14.0       locfit_1.5-9.7           
[111] grid_4.2.2                sass_0.4.5               
[113] tools_4.2.2               timechange_0.2.0         
[115] future.apply_1.10.0       parallel_4.2.2           
[117] rstudioapi_0.14           git2r_0.31.0             
[119] gridExtra_2.3             farver_2.1.1             
[121] Rtsne_0.16                digest_0.6.31            
[123] shiny_1.7.4               Rcpp_1.0.10              
[125] broom_1.0.3               later_1.3.0              
[127] RcppAnnoy_0.0.20          httr_1.4.4               
[129] AnnotationDbi_1.60.0      colorspace_2.1-0         
[131] rvest_1.0.3               XML_3.99-0.13            
[133] fs_1.6.1                  tensor_1.5               
[135] reticulate_1.28           splines_4.2.2            
[137] uwot_0.1.14               spatstat.utils_3.0-1     
[139] sp_1.6-0                  plotly_4.10.1            
[141] xtable_1.8-4              jsonlite_1.8.4           
[143] R6_2.5.1                  pillar_1.8.1             
[145] htmltools_0.5.4           mime_0.12                
[147] DT_0.27                   glue_1.6.2               
[149] fastmap_1.1.0             BiocParallel_1.32.5      
[151] codetools_0.2-19          utf8_1.2.3               
[153] lattice_0.20-45           bslib_0.4.2              
[155] spatstat.sparse_3.0-0     ggbeeswarm_0.7.1         
[157] leiden_0.4.3              zip_2.2.2                
[159] openxlsx_4.2.5.2          survival_3.5-3           
[161] limma_3.54.1              rmarkdown_2.20           
[163] munsell_0.5.0             GenomeInfoDbData_1.2.9   
[165] haven_2.5.1               reshape2_1.4.4           
[167] gtable_0.3.1